<?php

namespace App\Models\Shop;

use Illuminate\Database\Eloquent\Model;

class OrderProduct extends Model
{
   protected $table = 'order_products';

   protected $fillable = ['order_id', 'product_id', 'num'];

   public $timestamps = false;

   //订单商品属于商品
   public function product()
   {
      return $this->belongsTo(Product::class);
   }

   //订单商品属于订单
   public function order()
   {
      return $this->belongsTo(Order::class);
   }

}
